fn main() {
    let x = 5;
    println!("{x}");
    // x = 6; // cannot assign twice to immutable variable
    // println!("{x}");

    // 变量 隐蔽
    let x = "abcde";
    println!("{x}, {}", x.len());

    // 隐蔽
    let x = "cdef";
    println!("{x}");

    let mut m = "可编辑";
    println!("{m}");
    m = "修改后";
    println!("{m}");

    const PI: f64 = 3.14159;
    println!("{PI}");
    const VAR: &str = "常量 必须 注明值的类型";
    println!("{VAR}");

    // 整型
    let i = 1_000;
    let h = 0x12;
    let o = 0o17;
    let b = 0b1000_0001;
    let c = b'A';
    println!("1_000:{i}, 0x12:{h}, 0o17:{o}, 0b1000_0001:{b}, 'A':{c}");

    // 浮点
    let f = 0.23;
    let f32: f32 = 0.12;
    println!("f64:{f}, f32:{f32}");

    // 字符
    let ch = 'z';
    let zh: char = 'ℤ'; // with explicit type annotation
    let heart_eyed_cat = '😻';
    println!("{ch}, {zh}, {heart_eyed_cat}");

    // 数组
    let ar = [1, 2, 3, 4, 5];
    let asame = [10; 3];
    println!("[1, 2, 3, 4, 5]:? {:?} [10;3]:#? {:#?}", ar, asame);
}
